package com.fhd.dao.Merchant;

import com.fhd.pojo.House;
import com.fhd.pojo.Merchant;

import java.sql.Connection;
import java.sql.Time;
import java.util.ArrayList;

public interface MerchantDao {
    // 通过账号得到商户
    public Merchant getLoginMerchant(Connection conn, String userCode);

    // 通过id得到商户
    public Merchant getMerchantById(Connection conn, int id);

    //注册商户账号
    public int signUpMerchant(Connection conn, String userCode, String userPassword, String userName,
                              String shopName, String address, String phone, String keyWord,
                              Time workTimeBegin,Time workTimeEnd);

    // 得到所有的商户信息
    public ArrayList<Merchant> getAllMerchant(Connection conn);

    // 模糊查询商家
    public ArrayList<Merchant> getSomeMerchant(Connection conn,String shopName);

    // 改变申请状态
    public int changeAppleSituation(Connection conn,int id,int situation);

    // 更改商户信息
    public int updateInformation(Connection conn,int id , String userCode, String userPassword, String userName,
                                 String shopName, String address, String phone, String keyWord,
                                 Time workTimeBegin,Time workTimeEnd,int openSituation);

    // 排序所有商户的信息
    public ArrayList<Merchant> orderMerchant(Connection conn,String soldNumberOrder,String createDateOrder);

    // 增加/减少余额
    public int updateMoney(Connection conn,int id,int money);

    //增加销量
    public int updateSoldNumber(Connection conn,int id,int soldNumber);
}
